package com.zjmzxfzhl.modules.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.common.base.BaseService;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchaseOrderDto;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchaseOrderUpdateDto;
import com.zjmzxfzhl.modules.purchase.controller.vo.PurchaseOrderVo;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseOrder;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.math.BigDecimal;

/**
 * Service
 *
 * @author 庄金明
 */
public interface PurchaseOrderService extends BaseService<PurchaseOrder> {
    /**
     * 分页查询
     *
     * @param page
     * @param purchaseOrder
     * @return
     */
    IPage<PurchaseOrderVo> list(IPage<PurchaseOrderVo> page, PurchaseOrderDto purchaseOrder);

    /**
     * 导入设备审批单
     *
     * @param multipartFile
     */
    void upload(MultipartFile multipartFile);

    /**
     * 删除设备审批单
     *
     * @param ids
     */
    void deleteByIds(String[] ids);

    /**
     * 更新设备审批单物料单价
     *
     * @param orderId
     * @param materialId
     * @param unitPrice
     */
    void updateUnitPrice(Long orderId, Long materialId, BigDecimal unitPrice);

    /**
     * 导出设备审批单
     *
     * @param orderId
     * @return
     */
    File export(Long orderId);

    /**
     * 新增或更新订单及详情
     * @param orderDto
     * @return
     */
    boolean addOrUpdateOrder(PurchaseOrderUpdateDto orderDto);
}
